*******************************************************
**************Do file for *****************************
* Knutsen, Carl Henrik (2013)**************************
* Democracy, State Capacity and Economic Growth********
* World Development 43(1):1-18*************************
*******************************************************  

* IMPORTANT NOTE: The PRS Group, from which I have purchased the ICRG Researcher's Dataset, does not allow me to post their
* data in original form online. This implies that the bureaucratic quality and investment profile indices are not part of the public
* replication dataset. As a consequence, most models in the paper cannot be replicated using the publicly available dataset,
* unless one has access to the ICRG Researcher's Dataset (the version the author purchased is dated February 2009). 

**For running the do file on the publicly available dataset, one needs to merge in ICRGInvest ICRGbuerqual ICRGcorrupt, which are the Investment Profile, Bureaucratic Quality and Corruption indices from the ICRG Researcher's Dataset 

*The following vairables (in the dataset after having urn this do file) are dropped:
* drop ICRGInvest ICRGbuerqual ICRGcorrupt l1BQI l2BQI l3BQI l4BQI l5BQI l6BQI l7BQI l8BQI l9BQI l10BQI l11BQI l12BQI l13BQI l14BQI l15BQI l16BQI l17BQI l18BQI l19BQI l20BQI ybqi average_BQI iabqualFHI iabqualpolity partyBQI npartyBQI


*clear
*use "M:\www_docs\Data\WD_CHK.dta", clear**

sort code year
xtset code year
set more off

keep code year country africa GDPPCgrowthWDI ICRGbuerqual statehist5 AggregFHI Politynonanarchyetc AREG percGrowthGDPPCPPP lnWDIGDPPP taxoninterntradepercrevenue ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s civwar postcw5 postcw3 Absolutelatitude urbanpop tradeinpercgdp landlocked codeclocka grossinvestmentpercgdp ICRGcorrupt ICRGInvest grownrollmentprimary HTmultipartytrad HTdomparty HTmilitmultipart HTmilitoneparty HTonepartytrad HTonepartymonarch HTmultipartymonarch

*********************************
**Descriptive statistics on p.5**
*********************************

*correlations FHI and BQI
correlate AggregFHI ICRGbuerqual if africa==1
correlate AggregFHI ICRGbuerqual

*Constructing average values of FHI and BQI for Scatterplots
by code, sort: generate l1BQI = ICRGbuerqual[_n-1]
by code, sort: generate l2BQI = ICRGbuerqual[_n-2]
by code, sort: generate l3BQI = ICRGbuerqual[_n-3]
by code, sort: generate l4BQI = ICRGbuerqual[_n-4]
by code, sort: generate l5BQI = ICRGbuerqual[_n-5]
by code, sort: generate l6BQI = ICRGbuerqual[_n-6]
by code, sort: generate l7BQI = ICRGbuerqual[_n-7]
by code, sort: generate l8BQI = ICRGbuerqual[_n-8]
by code, sort: generate l9BQI = ICRGbuerqual[_n-9]
by code, sort: generate l10BQI = ICRGbuerqual[_n-10]
by code, sort: generate l11BQI = ICRGbuerqual[_n-11]
by code, sort: generate l12BQI = ICRGbuerqual[_n-12]
by code, sort: generate l13BQI = ICRGbuerqual[_n-13]
by code, sort: generate l14BQI = ICRGbuerqual[_n-14]
by code, sort: generate l15BQI = ICRGbuerqual[_n-15]
by code, sort: generate l16BQI = ICRGbuerqual[_n-16]
by code, sort: generate l17BQI = ICRGbuerqual[_n-17]
by code, sort: generate l18BQI = ICRGbuerqual[_n-18]
by code, sort: generate l19BQI = ICRGbuerqual[_n-19]
by code, sort: generate l20BQI = ICRGbuerqual[_n-20]

sort code year
generate ybqi =.
generate average_BQI =.
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI+l16BQI+l17BQI+l18BQI+l19BQI+l20BQI)/21 if year==2004
mvencode ybqi if average_BQI!=. & year==2004, mv(21)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI+l16BQI+l17BQI+l18BQI+l19BQI)/20 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(20)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI+l16BQI+l17BQI+l18BQI)/19 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(19)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI+l16BQI+l17BQI)/18 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(18)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI+l16BQI)/17 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(17)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI+l15BQI)/16 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(16)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI+l14BQI)/15 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(15)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI+l13BQI)/14 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(14)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI+l12BQI)/13 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(13)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI+l11BQI)/12 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(12)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI+l10BQI)/11 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(11)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI+l9BQI)/10 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(10)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI+l8BQI)/9 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(9)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI+l7BQI)/8 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(8)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI+l6BQI)/7 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(7)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI+l5BQI)/6 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(6)
replace average_BQI = (ICRGbuerqual+l1BQI+l2BQI+l3BQI+l4BQI)/5 if year==2004 & average_BQI==.
mvencode ybqi if average_BQI!=. & year==2004, mv(5)

sort code year
by code, sort: generate  l1FHI = AggregFHI[_n-1]
by code, sort: generate  l2FHI = AggregFHI[_n-2]
by code, sort: generate l3FHI = AggregFHI[_n-3]
by code, sort: generate l4FHI = AggregFHI[_n-4]
by code, sort: generate l5FHI = AggregFHI[_n-5]
by code, sort: generate l6FHI = AggregFHI[_n-6]
by code, sort: generate l7FHI = AggregFHI[_n-7]
by code, sort: generate l8FHI = AggregFHI[_n-8]
by code, sort: generate l9FHI = AggregFHI[_n-9]
by code, sort: generate l10FHI = AggregFHI[_n-10]
by code, sort: generate  l11FHI = AggregFHI[_n-11]
by code, sort: generate  l12FHI = AggregFHI[_n-12]
by code, sort: generate l13FHI = AggregFHI[_n-13]
by code, sort: generate l14FHI = AggregFHI[_n-14]
by code, sort: generate l15FHI = AggregFHI[_n-15]
by code, sort: generate l16FHI = AggregFHI[_n-16]
by code, sort: generate l17FHI = AggregFHI[_n-17]
by code, sort: generate l18FHI = AggregFHI[_n-18]
by code, sort: generate l19FHI = AggregFHI[_n-19]
by code, sort: generate l20FHI = AggregFHI[_n-20]

sort code year
generate average_FHI=.
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI + l16FHI + l17FHI + l18FHI + l19FHI + l20FHI)/21 if year==2004 & ybqi==21
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI + l16FHI + l17FHI + l18FHI + l19FHI)/20 if year==2004 & ybqi==20
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI + l16FHI + l17FHI + l18FHI)/19 if year==2004 & ybqi==19
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI + l16FHI + l17FHI)/18 if year==2004 & ybqi==18
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI + l16FHI)/17 if year==2004 & ybqi==17
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI + l15FHI)/16 if year==2004 & ybqi==16
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI + l14FHI)/15 if year==2004 & ybqi==15
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI + l13FHI)/14 if year==2004 & ybqi==14
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI + l12FHI)/13 if year==2004 & ybqi==13
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI+l11FHI)/12 if year==2004 & ybqi==12
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI + l10FHI)/11 if year==2004 & ybqi==11
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI + l9FHI)/10 if year==2004 & ybqi==10
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI + l8FHI)/9 if year==2004 & ybqi==9
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI + l7FHI)/8 if year==2004 & ybqi==8
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI + l6FHI)/7 if year==2004 & ybqi==7
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI + l5FHI)/6 if year==2004 & ybqi==6
replace average_FHI = (AggregFHI + l1FHI + l2FHI + l3FHI + l4FHI)/5 if year==2004 & ybqi==5
sort code year
summarize average_FHI

*************************************************************
************Generating scatter plot on p. 5 *****************
*************************************************************
scatter average_FHI average_BQI if year==2004, mlabel(country)
**NB This scatterplot is not as nicely edited (e.g. with axis names, angle on the labels, etc.) as in paper; this editing was done manually in graph editor, and this also goes for the scatter plots below

***Correlations p.5; statehist
correlate statehist5 AggregFHI
correlate statehist5 AggregFHI if africa==1

*************************************************************
************Generating scatter plot on p. 6 *****************
*************************************************************
scatter average_BQI statehist5 if year==2004, mlabel(country)

**Correlations p.5 trade taxes as share of govt revenue
generate ntaxoninterntradepercrevenue = 100-taxoninterntradepercrevenue

correlate ICRGbuerqual ntaxoninterntradepercrevenue
correlate statehist5 ntaxoninterntradepercrevenue

**************************************************************
***Generating Table 1, p.7; descriptive stats*****************
**************************************************************
***Generating some of the required variables
generate ChowAfricaFHI = AggregFHI*africa
generate ChowAfricaPolity = Politynonanarchyetc*africa
generate iabqualFHI= ICRGbuerqual*AggregFHI
generate iabqualpolity= ICRGbuerqual*Politynonanarchyetc
generate statehfhi = AggregFHI*statehist5
by code, sort: generate l1logGDPpercapexch = logGDPpercapexch[_n-1]
sort code year
**African observations
*First, run models that allows for identifying the observations (see table note)
xtreg GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b1
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s, fe
estimates store b4
xtreg GDPPCgrowthWDI AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b4s

**small deviations here in number of obs. from reported in the paper (1-3 observations) for some variables
**Descriptive stats for African observations
tabstat GDPPCgrowthWDI statehist5 logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium if africa==1 & _est_b1==1, statistics( mean min max sd count ) columns(statistics)
tabstat ICRGbuerqual if africa==1 & _est_b4==1, statistics( mean min max sd count ) columns(statistics)
tabstat statehist5 if africa==1 & _est_b4s==1, statistics( mean min max sd count ) columns(statistics)

**Non-African observations 
*First, run models that allows for identifying the observations (see table note)
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b2
tabstat GDPPCgrowthWDI logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium if africa==0 & _est_b2==1, statistics( mean min max sd count ) columns(statistics)
tabstat ICRGbuerqual if africa==0 & _est_b4==1, statistics( mean min max sd count ) columns(statistics)
tabstat statehist5 if africa==0 & _est_b4s==1, statistics( mean min max sd count ) columns(statistics)

**Generating Appx Figure A1
**These are the two histograms that make up the figure (some editing was done manually in graph editor)
histogram AggregFHI if africa==1 & year<1990, discrete width(0.5) start(1) percent xscale(range(1 7)) xscale(nofextend) plotregion(margin(tiny))
histogram AggregFHI if africa==1 & year>1989 & year<2006, discrete width(0.5) start(1) percent xscale(range(1 7)) xscale(nofextend) plotregion(margin(tiny))

**********************************************************************************************************
*******************************MAIN ANALYSIS**************************************************************
**********************************************************************************************************

**********************************
************TABLE 2, p.8**********
**********************************
xtpcse GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtreg GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f1
estat sargan
estout a1 b1 d1 e1 f1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

***********************************
***********************************
**Robustness testing Table 2 res.**
***********************************
***********************************

****Footnote 7 on excluding ln regime duration, and impact on results
**equivalent to table 2
xtpcse GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtreg GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logWDIpop) artests(2)
estimates store d1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logWDIpop) artests(3)
estimates store e1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logWDIpop) artests(2)
estimates store f1
estat sargan
estout a1 b1 d1 e1 f1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

**Footnote 10: Investigate FE models when cluster SEs on country, here also robustness testing for the interaction models
xtreg GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe cluster(code)
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe cluster(code)
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s if africa==1, fe cluster(code)
xtreg GDPPCgrowthWDI AggregFHI  statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe cluster(code)
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s, fe cluster(code)
xtreg GDPPCgrowthWDI AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe cluster(code)

***Granger test discussed on p. 7
sort code year
by code, sort: generate growthLAG= GDPPCgrowthWDI[_n-1]
sort code year
by code, sort: generate FHILAG= AggregFHI[_n-1]
sort code year
xtpcse  AggregFHI growthLAG FHILAG if africa==1, correlation(psar1) rhotype(tscorr) pairwise

***Footnote 11: Test AB models with only FHI as endogenous
xtabond GDPPCgrowthWDI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI) artests(2) 
estat sargan
xtabond GDPPCgrowthWDI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI) artests(3)
estat sargan
xtabond logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI) artests(2)
estat sargan

*****Footnote 12: Test AB models heteroskedastic SEs to conduct AR tests
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat abond
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat abond
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estat abond

***Footnote 13: Two-step versions of the Arellano-Bond models to further investigate exclusion restriction
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, twostep lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d1tw
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, twostep lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e1tw
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, twostep lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f1tw
estat sargan

***Arellano-Bover models, p.7

xtdpdsys GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store bov1
estat sargan
xtdpdsys GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store bov2
estat sargan
xtdpdsys logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store bov3
estat sargan
estout bov1 bov2 bov3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*********************************************************************************************   
**Various other rob. checks mentioned on p.7, and detailed in online appendix, Section A.II**   
*********************************************************************************************

**Take out Botswana and Mauritius
xtpcse GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1& code!=20 & code!=108, correlation(psar1) rhotype(tscorr) pairwise
estimates store a11
xtreg GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1& code!=20 & code!=108, fe
estimates store b11
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& code!=20 & code!=108, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d11
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& code!=20 & code!=108, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e11
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1& code!=20 & code!=108, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f11
estat sargan
estout a11 b11 d11 e11 f11, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Use PPP-adjusted GDP
sort code year
by code, sort: generate l1lnWDIGDPPP= lnWDIGDPPP[_n-1]
sort code year

xtpcse percGrowthGDPPCPPP AggregFHI l1lnWDIGDPPP logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a12
xtreg percGrowthGDPPCPPP AggregFHI l1lnWDIGDPPP logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b12
xtabond percGrowthGDPPCPPP Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1lnWDIGDPPP logdurpl1 logWDIpop) artests(2)
estimates store d12
estat sargan
xtabond percGrowthGDPPCPPP	 Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1lnWDIGDPPP logdurpl1 logWDIpop) artests(3)
estimates store e12
estat sargan
xtabond lnWDIGDPPP Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f12
estat sargan
estout a12 b12 d12 e12 f12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Use Polity index rather than FHI
xtpcse GDPPCgrowthWDI Politynonanarchyetc l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a12
xtreg GDPPCgrowthWDI Politynonanarchyetc l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b12
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(Politynonanarchyetc l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d12
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(Politynonanarchyetc l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e12
estat sargan
xtabond logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(Politynonanarchyetc logdurpl1 logWDIpop) artests(2)
estimates store f12
estat sargan
estout a12 b12 d12 e12 f12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

** Control for civil war, and post-war recovery
xtpcse GDPPCgrowthWDI AggregFHI civwar l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a12
xtreg GDPPCgrowthWDI AggregFHI civwar l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b12
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d12
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI civwar l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e12
estat sargan
xtabond logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar logdurpl1 logWDIpop) artests(2)
estimates store f12
estat sargan
estout a12 b12 d12 e12 f12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse GDPPCgrowthWDI AggregFHI civwar postcw3 l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a121
xtreg GDPPCgrowthWDI AggregFHI civwar postcw3 l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b121
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar postcw3 l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d121
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI civwar postcw3 l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e121
estat sargan
xtabond logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar postcw3 logdurpl1 logWDIpop) artests(2)
estimates store f121
estat sargan
estout a121 b121 d121 e121 f121, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse GDPPCgrowthWDI AggregFHI civwar postcw5 l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a122
xtreg GDPPCgrowthWDI AggregFHI civwar postcw5 l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b122
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar postcw5 l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d122
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI civwar postcw5 l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e122
estat sargan
xtabond logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI civwar postcw5 logdurpl1 logWDIpop) artests(2)
estimates store f122
estat sargan
estout a122 b122 d122 e122 f122, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Models including additional controls; landlockedness, absolute latitude, trade as share of GDP, and urban as share of total population
xtpcse GDPPCgrowthWDI AggregFHI Absolutelatitude urbanpop tradeinpercgdp landlocked l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a13
xtreg GDPPCgrowthWDI AggregFHI urbanpop tradeinpercgdp l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b13
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI urbanpop tradeinpercgdp l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d13
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI urbanpop tradeinpercgdp l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e13
estat sargan
xtabond logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI urbanpop tradeinpercgdp logdurpl1 logWDIpop) artests(2)
estimates store f13
estat sargan
estout a13 b13 d13 e13 f13, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Testing 3-year lags on all indep. variables
by code, sort: generate le3GDPPCgrowthWDI = GDPPCgrowthWDI[_n+3]
by code, sort: generate le3logGDPpercapexch = logGDPpercapexch[_n+3]
xtpcse le3GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtreg le3GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b1
xtabond le3GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d1
estat sargan
xtabond le3GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e1
estat sargan
xtabond le3logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f1
estat sargan
estout a1 b1 d1 e1 f1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

**Testing 5-year lags on all indep. variables
by code, sort: generate le5GDPPCgrowthWDI = GDPPCgrowthWDI[_n+5]
by code, sort: generate le5logGDPpercapexch = logGDPpercapexch[_n+5]
xtpcse le5GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtreg le5GDPPCgrowthWDI AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store b1
xtabond le5GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d1
estat sargan
xtabond le5GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e1
estat sargan
xtabond le5logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store f1
estat sargan
estout a1 b1 d1 e1 f1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

*******************************************************************************************
******************* APPENDIX TABLE A2, discussed in Section A-II, and bottom p.7 in paper**
*******************************************************************************************
xtpcse GDPPCgrowthWDI AggregFHI ChowAfricaFHI africa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b2
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d2
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e2
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI logdurpl1 logWDIpop) artests(2)
estimates store f2
estat sargan
estout a2 b2 d2 e2 f2, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

**************************************************
***********Rob testing Table A2*******************
**************************************************

**Footnote 6, excl. regime duration
xtpcse GDPPCgrowthWDI AggregFHI ChowAfricaFHI africa l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI l1logGDPpercapexch logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b2
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logWDIpop) artests(2)
estimates store d2
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logWDIpop) artests(3)
estimates store e2
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI logWDIpop) artests(2)
estimates store f2
estat sargan
estout a2 b2 d2 e2 f2, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

***Two-step versions of the Arellano-Bond models to further investigate exclusion restriction
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, twostep lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d2tw
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, twostep lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e2tw
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s, twostep lags(1) endog(AggregFHI ChowAfricaFHI logdurpl1 logWDIpop) artests(2)
estimates store f2tw
estat sargan
estout d2tw e2tw f2tw, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Arellano-Bover models to check robustness of results
xtdpdsys GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store bov1
estat sargan
xtdpdsys GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store bov2
estat sargan
xtdpdsys logGDPpercapexch  Dec60s Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI logdurpl1 logWDIpop) artests(2)
estimates store bov3
estat sargan
estout bov1 bov2 bov3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)
   
   
***Using Polity index   
generate Polityafrica= Politynonanarchyetc*africa

xtpcse GDPPCgrowthWDI Politynonanarchyetc Polityafrica africa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a12
xtreg GDPPCgrowthWDI Politynonanarchyetc Polityafrica l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s, fe
estimates store b12
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s, lags(1) endog(Politynonanarchyetc Polityafrica l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store d12
estat sargan
xtabond GDPPCgrowthWDI Dec60s Dec70s Dec80s Dec90s, lags(2) endog(Politynonanarchyetc Polityafrica l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store e12
estat sargan
xtabond logGDPpercapexch Dec60s Dec70s Dec80s Dec90s, lags(1) endog(Politynonanarchyetc Polityafrica logdurpl1 logWDIpop) artests(2)
estimates store f12
estat sargan
estout a12 b12 d12 e12 f12, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************************************************************
******************************************************************************************
** RETURNING TO MAIN ANALYSIS; Section C; Interaction models******************************
******************************************************************************************
******************************************************************************************

*Correlations state capacity and growth for democracies and autocracies, p.8
correlate GDPPCgrowthWDI ICRGbuerqual if AggregFHI<2.5 & AggregFHI>0
correlate GDPPCgrowthWDI ICRGbuerqual if AggregFHI>5.5 & AggregFHI<8
correlate GDPPCgrowthWDI statehist5 if AggregFHI<2.5 & AggregFHI>0
correlate GDPPCgrowthWDI statehist5 if AggregFHI>5.5 & AggregFHI<8

******************************************************************************************
******************************************************************************************
                                       **TABLE3**
******************************************************************************************
******************************************************************************************
xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s, fe
estimates store b4
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store c4
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store d4
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estimates store e4
estat sargan
xtpcse GDPPCgrowthWDI AggregFHI  statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4s
xtreg GDPPCgrowthWDI AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b4s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store c4s
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store d4s
estat sargan
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estimates store e4s
estat sargan
estout a4 b4 c4 d4 e4 a4s b4s c4s d4s e4s, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

*******************************************************************************
** Robustness testing Table 3
*******************************************************************************

**Footnote 6 (dropping log regime duration)
xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop Dec80s Dec90s, fe
estimates store b4
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop) artests(2)
estimates store c4
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop) artests(3)
estimates store d4
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logWDIpop) artests(3)
estimates store e4
estat sargan
xtpcse GDPPCgrowthWDI AggregFHI  statehist5 statehfhi l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4s
xtreg GDPPCgrowthWDI AggregFHI statehfhi l1logGDPpercapexch logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b4s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logWDIpop) artests(2)
estimates store c4s
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logWDIpop) artests(3)
estimates store d4s
estat sargan
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi logWDIpop) artests(2)
estimates store e4s
estat sargan
estout a4 b4 c4 d4 e4 a4s b4s c4s d4s e4s, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

***Arellano-Bover, p.10 
xtdpdsys GDPPCgrowthWDI Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys logGDPpercapexch Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estat sargan 

********Testing two-step AB models, footnote 15
xtabond GDPPCgrowthWDI Dec80s Dec90s, twostep lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s, twostep lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s, twostep lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, twostep lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, twostep lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, twostep lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estat sargan 

***checking for AR autocorrelation, footnote 15
xtabond GDPPCgrowthWDI Dec80s Dec90s, vce(robust) lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat abond
xtabond GDPPCgrowthWDI Dec80s Dec90s, vce(robust) lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat abond
xtabond logGDPpercapexch Dec80s Dec90s, vce(robust) lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estat abond
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, vce(robust) lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat abond
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, vce(robust) lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat abond
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, vce(robust) lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estat abond 


********************************************************************
***************APPX TABLE A3, p.10 discussion and appx sect. A-III**
********************************************************************

xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s if africa==1, fe
estimates store b3
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store c3
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store d3
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estimates store e3
estat sargan
xtpcse GDPPCgrowthWDI AggregFHI  statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3s
xtreg GDPPCgrowthWDI AggregFHI  statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store b3s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store c3s
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store d3s
estat sargan
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estimates store e3s
estat sargan
estout a3 b3 c3 d3 e3 a3s b3s c3s d3s e3s, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

*****************************************************************
* Rob testing Table A3 models
*****************************************************************

****FOOTNOTE 6 on excluding ln regime duration
xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop Dec80s Dec90s if africa==1, fe
estimates store b3
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop) artests(2)
estimates store c3
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logWDIpop) artests(3)
estimates store d3
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logWDIpop) artests(3)
estimates store e3
estat sargan
xtpcse GDPPCgrowthWDI AggregFHI  statehist5 statehfhi l1logGDPpercapexch logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3s
xtreg GDPPCgrowthWDI AggregFHI  statehfhi l1logGDPpercapexch logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store b3s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logWDIpop) artests(2)
estimates store c3s
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logWDIpop) artests(3)
estimates store d3s
estat sargan
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi logWDIpop) artests(2)
estimates store e3s
estat sargan
estout a3 b3 c3 d3 e3 a3s b3s c3s d3s e3s, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

**A-Bover version of A3 GMM models
xtdpdsys GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys logGDPpercapexch Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat sargan
xtdpdsys GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat sargan
xtdpdsys logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estat sargan 

***Checking for AR autocorrelation, Table A3 models
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat abond
xtabond GDPPCgrowthWDI Dec80s Dec90s if africa==1, vce(robust) lags(2) endog(AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat abond
xtabond logGDPpercapexch Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI ICRGbuerqual iabqualFHI logdurpl1 logWDIpop) artests(3)
estat abond
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estat abond
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estat abond
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, vce(robust) lags(1) endog(AggregFHI statehfhi logdurpl1 logWDIpop) artests(2)
estat abond 

************************************************************
**************** TABLE A4 **********************************
************************************************************
generate tradetaxfhi = AggregFHI*ntaxoninterntradepercrevenue

xtpcse GDPPCgrowthWDI AggregFHI tradetaxfhi ntaxoninterntradepercrevenue l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store tt1
xtreg GDPPCgrowthWDI AggregFHI tradetaxfhi ntaxoninterntradepercrevenue l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s if africa==1, fe
estimates store tt2
xtabond GDPPCgrowthWDI Dec90s if africa==1, lags(1) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop l1logGDPpercapexch) artests(2)
estimates store tt3
estat sargan
xtabond GDPPCgrowthWDI Dec90s if africa==1, lags(2) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop l1logGDPpercapexch) artests(3)
estimates store tt4
estat sargan
xtabond logGDPpercapexch Dec90s if africa==1, lags(1) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop) artests(2)
estimates store tt5
estat sargan
xtpcse GDPPCgrowthWDI AggregFHI tradetaxfhi ntaxoninterntradepercrevenue l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store tt6
xtreg GDPPCgrowthWDI AggregFHI tradetaxfhi ntaxoninterntradepercrevenue l1logGDPpercapexch logdurpl1 logWDIpop Dec80s Dec90s, fe
estimates store tt7
xtabond GDPPCgrowthWDI Dec90s, lags(1) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop l1logGDPpercapexch) artests(2)
estimates store tt8
estat sargan
xtabond GDPPCgrowthWDI Dec90s, lags(2) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop l1logGDPpercapexch) artests(3)
estimates store tt9
estat sargan
xtabond logGDPpercapexch Dec90s, lags(1) endog(AggregFHI tradetaxfhi ntaxoninterntradepercrevenue logdurpl1 logWDIpop) artests(2)
estimates store tt10
estat sargan
estout tt1 tt2 tt3 tt4 tt5 tt6 tt7 tt8 tt9 tt10, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***********************************************************
********FIGURE 4 and related analysis on p. 10*************
***********************************************************
***Find changes in ACLP measure, later to be used for identifying democratization
by code, sort: generate l1AREG =AREG[_n-1]
generate diffAREG = AREG-l1AREG
sort code year
summarize diffAREG, detail

***Generate pre- and post-democratization 10 year growth averages
by code, sort: generate l10gdppcg= logGDPpercapexch[_n-10]
by code, sort: generate lead10gdppcgr = logGDPpercapexch[_n+10]
sort code year
generate priorgrowthten= 100*(logGDPpercapexch-l10gdppcg)/10
generate postgrowthten= 100*(lead10gdppcgr-logGDPpercapexch)/10
generate diffgrowthten = postgrowthten-priorgrowthten

generate codeclockc =codeclocka
replace codeclockc = 9 if country =="South Africa"
replace codeclockc = 9 if country =="Uruguay"
replace codeclockc = 9 if country =="Malawi"
replace codeclockc = 12 if country =="Mongolia"
replace codeclockc = 8 if country =="Ghana"
replace codeclockc = 3 if country =="Mali"
replace codeclockc = 3 if country =="Guatemala"
replace codeclockc = 3 if country =="Bangladesh"
replace codeclockc = 3 if country =="Congo, Rep."
replace codeclockc = 3 if country =="Madagascar"

**********
* FIGURE 4
**********
twoway (scatter diffgrowthten ICRGbuerqual if diffAREG==-1, mlabel(country) mlabsize(tiny) mlabv(codeclockc) yscale(range(-4 12)) ylabel(-5(5)12.2)) (lfit diffgrowthten ICRGbuerqual if diffAREG==-1) 

****Regressions on differences in growth rates discussed on page 10
regress diffgrowthten ICRGbuerqual if diffAREG==-1
regress diffgrowthten ICRGbuerqual logGDPpercapexch if diffAREG==-1
regress diffgrowthten ICRGbuerqual l10gdppcg if diffAREG==-1

regress diffgrowthten statehist5 if diffAREG==-1
regress diffgrowthten statehist5 logGDPpercapexch if diffAREG==-1
regress diffgrowthten statehist5 l10gdppcg if diffAREG==-1


*********************************************************************************************************
*******P. 10 Discussion on regressions conducted on different samples (with low and high state capacity)*
*********************************************************************************************************
***Split sample	
**Africa
xtpcse GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1 & ICRGbuerqual>1.99999, correlation(psar1) rhotype(tscorr) pairwise
estimates store spa1
xtreg GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual>1.99999, fe
estimates store spb1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual>1.99999, lags(1) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store spd1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual>1.99999, lags(2) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store spe1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual>1.99999, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store spf1
estat sargan
estout spa1 spb1 spd1 spe1 spf1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)
	
xtpcse GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1 & ICRGbuerqual<2, correlation(psar1) rhotype(tscorr) pairwise
estimates store ssa1
xtreg GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual<2, fe
estimates store ssb1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual<2, lags(1) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store ssd1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual<2, lags(2) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store sse1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if africa==1& ICRGbuerqual<2, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store ssf1
estat sargan	
estout ssa1 ssb1 ssd1 sse1 ssf1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Globally	
xtpcse GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if ICRGbuerqual>1.99999, correlation(psar1) rhotype(tscorr) pairwise
estimates store spa1
xtreg GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if ICRGbuerqual>1.99999, fe
estimates store spb1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if ICRGbuerqual>1.99999, lags(1) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store spd1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if ICRGbuerqual>1.99999, lags(2) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store spe1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if ICRGbuerqual>1.99999, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store spf1
estat sargan
estout spa1 spb1 spd1 spe1 spf1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)
	
xtpcse GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if ICRGbuerqual<2, correlation(psar1) rhotype(tscorr) pairwise
estimates store ssa1
xtreg GDPPCgrowthWDI AggregFHI logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if ICRGbuerqual<2, fe
estimates store ssb1
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if ICRGbuerqual<2, lags(1) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store ssd1
estat sargan
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if ICRGbuerqual<2, lags(2) endog(AggregFHI logGDPpercapexch logdurpl1 logWDIpop) artests(3)
estimates store sse1
estat sargan
xtabond logGDPpercapexch  Dec70s Dec80s Dec90s if ICRGbuerqual<2, lags(1) endog(AggregFHI logdurpl1 logWDIpop) artests(2)
estimates store ssf1
estat sargan	
estout ssa1 ssb1 ssd1 sse1 ssf1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)	
	
*******************************************************************************
****** Braumoeller-type interaction Figures, drawing on Braumoeller's do file**
*******************************************************************************

************
***Figure 5*
************



************************************************
***Effects of FHI as function of BQI, top plot**
************************************************


/* 1. Clean the slate. */
version 8

/* 3. Run standard regression. */
xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize ICRGbuerqual, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=9  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=1  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen ICRGbuerquala=ICRGbuerqual-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize ICRGbuerquala
   gen iabqualFHIa=AggregFHI*ICRGbuerquala
   xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerquala iabqualFHIa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
   matrix betas=e(b)                /* Stop alterations. */
   scalar AggregFHIcoef=betas[1,`order']
   matrix ses=e(V)
   scalar AggregFHIse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = AggregFHIcoef-ci95*AggregFHIse, AggregFHIcoef, AggregFHIcoef+ci95*AggregFHIse, `xval'
   matrix foo2 = foo2 \ foo
   drop ICRGbuerquala iabqualFHIa
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram ICRGbuerqual, bin(8) percent yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ BQI, axis(2))/*
*/ ytitle(Regression Coefficients on FHI and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(ICRGbuerqual)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on AggregFHI at Different Levels of ICRGbuerqual) subtitle(Overlaid with/*
*/ Histogram of ICRGbuerqual) legend(off)

drop points1 points2 points3 points4

****************************************************
******Analysis on Statehist5, bottom plot figure 5**
****************************************************

/* 3. Run standard regression. */
xtpcse GDPPCgrowthWDI AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize statehist5, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=11  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=1  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen statehist5a=statehist5-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize statehist5a
   gen statehfhia=AggregFHI*statehist5a
   xtpcse GDPPCgrowthWDI AggregFHI statehist5a statehfhia l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
   matrix betas=e(b)                /* Stop alterations. */
   scalar AggregFHIcoef=betas[1,`order']
   matrix ses=e(V)
   scalar AggregFHIse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = AggregFHIcoef-ci95*AggregFHIse, AggregFHIcoef, AggregFHIcoef+ci95*AggregFHIse, `xval'
   matrix foo2 = foo2 \ foo
   drop statehist5a statehfhia
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram statehist5, bin(10) percent yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ statehist5, axis(2))/*
*/ ytitle(Regression Coefficients on AggregFHI and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(statehist5)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on AggregFHI at Different Levels of statehist5) subtitle(Overlaid with/*
*/ Histogram of statehist5) legend(off)

drop points1 points2 points3 points4


*********************************************************************************************
**Equivalent to FIGURE 5, but based on FE models, see Footnotes 17 and 18 and discussion p.10
*********************************************************************************************
******TOP PLOT*******************************************************************************

/* 3. Run standard regression. */
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize ICRGbuerqual, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=9  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=1  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen ICRGbuerquala=ICRGbuerqual-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize ICRGbuerquala
   gen iabqualFHIa=AggregFHI*ICRGbuerquala
   xtreg GDPPCgrowthWDI AggregFHI ICRGbuerquala iabqualFHIa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe
   matrix betas=e(b)                /* Stop alterations. */
   scalar AggregFHIcoef=betas[1,`order']
   matrix ses=e(V)
   scalar AggregFHIse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = AggregFHIcoef-ci95*AggregFHIse, AggregFHIcoef, AggregFHIcoef+ci95*AggregFHIse, `xval'
   matrix foo2 = foo2 \ foo
   drop ICRGbuerquala iabqualFHIa
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram ICRGbuerqual, yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ ICRGbuerqual, axis(2))/*
*/ ytitle(Regression Coefficients on AggregFHI and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(ICRGbuerqual)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on AggregFHI at Different Levels of ICRGbuerqual) subtitle(Overlaid with/*
*/ Histogram of ICRGbuerqual) legend(off)

drop points1 points2 points3 points4

*************************************
**BOTTOM PLOT, FE VERSION OF FIGURE 5
*************************************

/* 3. Run standard regression. */
xtreg GDPPCgrowthWDI AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize statehist5, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=11  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=1  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen statehist5a=statehist5-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize statehist5a
   gen statehfhia=AggregFHI*statehist5a
   xtreg GDPPCgrowthWDI AggregFHI statehist5a statehfhia l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe
   matrix betas=e(b)                /* Stop alterations. */
   scalar AggregFHIcoef=betas[1,`order']
   matrix ses=e(V)
   scalar AggregFHIse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = AggregFHIcoef-ci95*AggregFHIse, AggregFHIcoef, AggregFHIcoef+ci95*AggregFHIse, `xval'
   matrix foo2 = foo2 \ foo
   drop statehist5a statehfhia
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram statehist5, yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ statehist5, axis(2))/*
*/ ytitle(Regression Coefficients on AggregFHI and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(statehist5)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on AggregFHI at Different Levels of statehist5) subtitle(Overlaid with/*
*/ Histogram of statehist5) legend(off)

drop points1 points2 points3 points4



**************************************
**************************************
***FIGURE 6***************************
**************************************
**************************************

************************************
************TOP PLOT****************
************************************

/* 3. Run standard regression. */
xtpcse GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize AggregFHI, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=13  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=2  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen AggregFHIa=AggregFHI-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize AggregFHIa
   gen iabqualFHIa=AggregFHIa*ICRGbuerqual
   xtpcse GDPPCgrowthWDI AggregFHIa ICRGbuerqual iabqualFHIa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
   matrix betas=e(b)                /* Stop alterations. */
   scalar ICRGbuerqualcoef=betas[1,`order']
   matrix ses=e(V)
   scalar ICRGbuerqualse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = ICRGbuerqualcoef-ci95*ICRGbuerqualse, ICRGbuerqualcoef, ICRGbuerqualcoef+ci95*ICRGbuerqualse, `xval'
   matrix foo2 = foo2 \ foo
   drop AggregFHIa iabqualFHIa
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram AggregFHI, bin(12) percent yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ AggregFHIa, axis(2))/*
*/ ytitle(Regression Coefficients on ICRGbuerqual and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(AggregFHI)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on ICRGbuerqual at Different Levels of AggregFHI) subtitle(Overlaid with/*
*/ Histogram of AggregFHI) legend(off)

drop points1 points2 points3 points4

**************************************
***************BOTTOM PLOT************
**************************************

/* 3. Run standard regression. */
xtpcse GDPPCgrowthWDI AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize AggregFHI, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=13  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=2  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen AggregFHIa=AggregFHI-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize AggregFHIa
   gen statehfhia=AggregFHIa*statehist5
   xtpcse GDPPCgrowthWDI AggregFHIa statehist5 statehfhia l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
   matrix betas=e(b)                /* Stop alterations. */
   scalar statehist5coef=betas[1,`order']
   matrix ses=e(V)
   scalar statehist5se=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = statehist5coef-ci95*statehist5se, statehist5coef, statehist5coef+ci95*statehist5se, `xval'
   matrix foo2 = foo2 \ foo
   drop AggregFHIa statehfhia
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram AggregFHI, bin(12) percent yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ AggregFHIa, axis(2))/*
*/ ytitle(Regression Coefficients on statehist5 and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(AggregFHI)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on statehist5 at Different Levels of AggregFHI) subtitle(Overlaid with/*
*/ Histogram of AggregFHI) legend(off)

drop points1 points2 points3 points4



************************************************
************FIXED EFFECTS VERsions of Figure 6**
************************************************

**************
*TOP PLOT*****
**************

/* 3. Run standard regression. */
xtreg GDPPCgrowthWDI AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe

/* 4. Gather parameters, initialize matrix for runs */
quietly summarize AggregFHI, detail /* Change x2 to variable that you want to appear on X-axis */
local min=r(min)
local max=r(max)
local cen25=r(p25)
local cen50=r(p50)
local cen75=r(p75)
local numparams=13  /*Set number of coefficients to be graphed HERE */
local inc=(`max'-`min')/(`numparams'-1)
local iter=0
matrix foo2 = 0,0,0,0
local order=2  /* Replace this number with a number that will tell Stata which IV's coefs. you */
               /* want to graph -- first, second, third, etc.  In this example, we want to graph */
               /* x1's coefficients as a function of x2, and x1 is the first independent variable */
               /* listed in the regress command, so we would enter a 1. */

/* 5. Calculate coefficients for x1 across range of x2, store in matrix foo2 */
while `iter'<`numparams' { 
   gen AggregFHIa=AggregFHI-`min'-(`inc'*`iter')  /* Alter these four lines to fit your model. */
   summarize AggregFHIa
   gen iabqualFHIa=AggregFHIa*ICRGbuerqual
   xtreg GDPPCgrowthWDI AggregFHIa ICRGbuerqual iabqualFHIa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, fe
   matrix betas=e(b)                /* Stop alterations. */
   scalar ICRGbuerqualcoef=betas[1,`order']
   matrix ses=e(V)
   scalar ICRGbuerqualse=sqrt(ses[`order',`order'])
   local obs=e(N)                     /* Calculate 95% confidence intervals.  Assumes t-tests for signif.; */
   scalar ci95=invttail(`obs', 0.025) /* if using procedure that produces z-tests, use invnorm(0.975) */
   local xval = `min'+(`inc'*`iter')
   matrix foo = ICRGbuerqualcoef-ci95*ICRGbuerqualse, ICRGbuerqualcoef, ICRGbuerqualcoef+ci95*ICRGbuerqualse, `xval'
   matrix foo2 = foo2 \ foo
   drop AggregFHIa iabqualFHIa
   local iter=`iter'+1
   }

/* 6. Convert matrix into data */
matrix points=foo2[2..(`numparams'+1),1..4]
svmat points

/* 7. Produce graph if x2 is continuous, or if x2 is ordinal but */
/* fractional values are not conceptually inconceivable (e.g. some */
/* continuous quantity for which only ordinal measures are available). */
/* Change titles, labels, etc., to fit your particular needs */
twoway (connect points1 points2 points3 points4, mcolor(navy maroon navy)/*
*/ clcolor(navy maroon navy) msymbol(diamond circle diamond))/*
*/ (histogram AggregFHI, yaxis(2) blcolor(gray) bfcolor(none)), ytitle(Histogram of/*
*/ AggregFHIa, axis(2))/*
*/ ytitle(Regression Coefficients on ICRGbuerqual and 95% CIs)/*
*/ ylabel(, labsize(medium)) yline(0, lwidth(medthick)) xtitle(AggregFHI)/*
*/ xlabel(`min' "Minimum" `cen50' "Median" `max' "Maximum", labsize(small))/*
*/ title(Coefficients on ICRGbuerqual at Different Levels of AggregFHI) subtitle(Overlaid with/*
*/ Histogram of AggregFHI) legend(off)

drop points1 points2 points3 points4



*****************************************
*****************************************	
*****************************************

*ANALYSIS ON DIFFERENT DEPENDENT VARIABLES; Section 3d

************************
**GENERATE TABLE 4, FE**
************************
xtreg grossinvestmentpercgdp AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store a4
xtreg grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store b4
xtreg ICRGcorrupt AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store c4
xtreg ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store d4
xtreg ICRGInvest AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store e4
xtreg ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store f4
xtreg grownrollmentprimary AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store g4
xtreg grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store h4
estout a4 b4 c4 d4 e4 f4 g4 h4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

by year, sort: summarize  _est_a4 _est_b4 _est_c4 _est_d4 _est_e4 _est_f4 _est_g4 _est_h4

************************************
**GENERATE APPX TABLE A5, OLS PCSE**
************************************


xtpcse grossinvestmentpercgdp AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4a
xtpcse grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store b4a
xtpcse ICRGcorrupt AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store c4a
xtpcse ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store d4a
xtpcse ICRGInvest AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store e4a
xtpcse ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store f4a
xtpcse grownrollmentprimary AggregFHI  l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store g4a
xtpcse grownrollmentprimary AggregFHI ICRGbuerqual iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) hetonly pairwise
estimates store h4a
estout  a4a b4a c4a d4a e4a f4a g4a h4a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

*******************************************************************************
* All model specifications run on the four dep. var's; discussions on pp. 12-14
*******************************************************************************

**********************************
***Effects on investment per gdp**
**********************************
  
xtpcse grossinvestmentpercgdp AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grossinvestmentpercgdp AggregFHI africa ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grossinvestmentpercgdp AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grossinvestmentpercgdp AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grossinvestmentpercgdp AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grossinvestmentpercgdp Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*********************************
*********************Corruption**
*********************************

xtpcse ICRGcorrupt AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGcorrupt AggregFHI africa ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGcorrupt AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGcorrupt AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGcorrupt AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGcorrupt Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*******************************
***property rightas protection*
*******************************

xtpcse ICRGInvest AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGInvest AggregFHI africa ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGInvest AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse ICRGInvest AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg ICRGInvest AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond ICRGInvest Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*********************************************
******gross primary school-enrollment ratio**
*********************************************

xtpcse grownrollmentprimary AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*xtpcse grownrollmentprimary AggregFHI africa ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
*fails to calculate covariance matrix; hence run hetonly version
xtpcse grownrollmentprimary AggregFHI africa ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) hetonly pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*xtpcse grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
*fails to calc covariance matrix, use hetonly version
xtpcse grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) hetonly pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse grownrollmentprimary AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*xtpcse grownrollmentprimary AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
*fails to calc covariance matrix, use hetonly version
xtpcse grownrollmentprimary AggregFHI statehist5 statehfhi l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) hetonly pairwise
estimates store olsf
xtreg grownrollmentprimary AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond grownrollmentprimary Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI statehfhi l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************************************
**********************FOOTNOTE 19 and Appx Section A-IV***********
******************************************************************

generate Dictparty = HTmultipartytrad+ HTdomparty+ HTmilitmultipart+ HTmilitoneparty+ HTonepartytrad+ HTonepartymonarch+ HTmultipartymonarch
generate Dictparty_narrow = HTmultipartytrad+ HTdomparty+ HTonepartytrad
generate partyBQI =  Dictparty*ICRGbuerqual
generate npartyBQI = Dictparty_narrow*ICRGbuerqual

******************************************************************
**********************Appx Table A.6******************************
******************************************************************
xtpcse GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(1) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(2) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s, lags(1) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI logdurpl1 logWDIpop) artests(2)
estimates store u
estat sargan
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

******************************************************************
**Additional models discussed in Section A-IV*********************
******************************************************************

**Adding party dummies to baseline specification, African samples
xtpcse GDPPCgrowthWDI AggregFHI Dictparty l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI Dictparty l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty logdurpl1 logWDIpop ) artests(2)
estimates store u
estout  olsf fef s u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse GDPPCgrowthWDI AggregFHI Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty_narrow logdurpl1 logWDIpop) artests(2)
estimates store u
estout  olsf fef s u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Global samples
generate Chowpartyafrica = Dictparty*africa
generate Chownpartyafrica = Dictparty_narrow*africa

xtpcse GDPPCgrowthWDI AggregFHI ChowAfricaFHI Chowpartyafrica Dictparty africa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI Chowpartyafrica Dictparty l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI Chowpartyafrica Dictparty l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI Chowpartyafrica Dictparty l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI Chowpartyafrica Dictparty logdurpl1 logWDIpop ) artests(2)
estimates store u
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse GDPPCgrowthWDI AggregFHI ChowAfricaFHI Chownpartyafrica Dictparty_narrow africa l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec60s Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI ChowAfricaFHI Chownpartyafrica Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop Dec60s Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI Chownpartyafrica Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI ChowAfricaFHI Chownpartyafrica Dictparty_narrow l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI ChowAfricaFHI Chownpartyafrica Dictparty_narrow logdurpl1 logWDIpop) artests(2)
estimates store u
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

**Interaction with BQI, Africa
xtpcse GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

xtpcse GDPPCgrowthWDI AggregFHI Dictparty_narrow npartyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s if africa==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty_narrow npartyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s if africa==1, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s if africa==1, lags(2) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s if africa==1, lags(1) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Interaction with BQI, global sample
xtpcse GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty partyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(1) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
estat sargan
xtabond GDPPCgrowthWDI Dec80s Dec90s, lags(2) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
estat sargan
xtabond logGDPpercapexch Dec80s Dec90s, lags(1) endog(AggregFHI partyBQI Dictparty ICRGbuerqual  iabqualFHI logdurpl1 logWDIpop) artests(2)
estimates store u
estat sargan
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (fixed)

xtpcse GDPPCgrowthWDI AggregFHI Dictparty_narrow npartyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop ethfrac romcath protestanglicmethod indig islamsunni britishameric french portugese belgium Dec70s Dec80s Dec90s, correlation(psar1) rhotype(tscorr) pairwise
estimates store olsf
xtreg GDPPCgrowthWDI AggregFHI Dictparty_narrow npartyBQI ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop Dec70s Dec80s Dec90s, fe
estimates store fef
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store s
xtabond GDPPCgrowthWDI Dec70s Dec80s Dec90s, lags(2) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI l1logGDPpercapexch logdurpl1 logWDIpop) artests(2)
estimates store t
xtabond logGDPpercapexch Dec70s Dec80s Dec90s, lags(1) endog(AggregFHI Dictparty_narrow npartyBQI  ICRGbuerqual  iabqualFHI logdurpl1 logWDIpop) artests(2)
estimates store t
estout  olsf fef s t u, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


	
************************************************************
************END OF DO FILE**********************************
************************************************************
